//
//  LogisticsTableViewCell.m
//  AnXin100
//
//  Created by Sakura on 2018/10/31.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "LogisticsTableViewCell.h"

@interface LogisticsTableViewCell ()

@property (nonatomic, strong) UIImageView *headImageView;

@property (nonatomic, strong) UILabel *logisticsStatusLabel;

@property (nonatomic, strong) UILabel *logisticsCompanyLabel;

@property (nonatomic, strong) UILabel *logisticsNumberLabel;

@end

@implementation LogisticsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatCell];
    }
    return self;
}

- (void)creatCell {
    _headImageView = [[UIImageView alloc] init];
    _headImageView.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_headImageView];
    
    _logisticsStatusLabel = [UILabel new];
    _logisticsStatusLabel.text = @"物流状态：运输中";
    _logisticsStatusLabel.textColor = [UIColor colorWithHex:0x333333];
    _logisticsStatusLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_logisticsStatusLabel];
    
    _logisticsCompanyLabel = [UILabel new];
    _logisticsCompanyLabel.textColor = [UIColor colorWithHex:0x333333];
    _logisticsCompanyLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_logisticsCompanyLabel];
    _logisticsCompanyLabel.text = @"快递公司：顺丰快递";

    
    _logisticsNumberLabel = [UILabel new];
    _logisticsNumberLabel.textColor = [UIColor colorWithHex:0x333333];
    _logisticsNumberLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_logisticsNumberLabel];
    _logisticsNumberLabel.text = @"快递单号：DHN5632458126";
}

- (void)layoutSubviews {
    
    _headImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .bottomSpaceToView(self.contentView, 10)
    .widthIs(85);
    
    _logisticsStatusLabel.sd_layout
    .leftSpaceToView(_headImageView, 10)
    .topSpaceToView(self.contentView, 10)
    .rightSpaceToView(self.contentView, 10)
    .autoHeightRatio(0);
    
    _logisticsCompanyLabel.sd_layout
    .leftEqualToView(_logisticsStatusLabel)
    .rightEqualToView(_logisticsStatusLabel)
    .topSpaceToView(_logisticsStatusLabel, 7)
    .autoHeightRatio(0);
    
    _logisticsNumberLabel.sd_layout
    .leftEqualToView(_logisticsStatusLabel)
    .rightEqualToView(_logisticsStatusLabel)
    .topSpaceToView(_logisticsCompanyLabel, 7)
    .autoHeightRatio(0);
    
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
